
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@patternfly/pfe-icon
Advanced tools
Read more about Icon in the PatternFly Elements Icon documentation
Load <pfe-icon>
via CDN:
<script src="https://unpkg.com/@patternfly/pfe-icon?module"></script>
Or, if you are using NPM, install it
npm install @patternfly/pfe-icon
Then once installed, import it to your application:
import '@patternfly/pfe-icon';
Place the icon element on the page and give it an icon name from the default icon set.
In most cases, the icon should be labelled using aria-label
or aria-labelledby
, or removed from
the accessibility tree with aria-hidden="true"
or role="presentation"
, if its content is merely
presentational and expressed using accessible text copy elsewhere.
<pfe-icon icon="award" aria-label="Awards"></pfe-icon>
If you wish to display some content while the icon loads (or while JS is disabled),
you can slot it into <pfe-icon>
. For instance, when using a checkmark icon in a server status
table, you may wish to display a checkmark emoji if JS is disabled.
<pfe-icon icon="check">✅</pfe-icon>
Icon comes with three built-in icon sets:
fas
: Font Awesome Free Solid icons (the default set)far
: Font Awesome Free Regular iconspatternfly
: PatternFly iconsUse the set
attribute to pick an alternative icon set.
<pfe-icon icon="star" set="far"></pfe-icon>
<pfe-icon icon="redhat" set="fab"></pfe-icon>
<pfe-icon icon="package" set="patternfly"></pfe-icon>
It is possible to add custom icon sets or override the default sets. Icon sets are defined in detail in the docs.
When bundling PfeIcon with other modules, the default icon imports will be relative to the bundle, not the source file, so be sure to either register all the icon sets you'll need, or override the default getter.
// Workaround for bundled pfe-icon: make icon imports absolute, instead of relative to the bundle
import { PfeIcon } from '/pfe.min.js';
PfeIcon.getIconUrl = (set, icon) =>
new URL(`/assets/icons/${set}/${icon}.js`, import.meta.url);
// default: new URL(`./icons/${set}/${icon}.js`, import.meta.url);
Icons load lazily by default, meaning that the browser will not attempt to fetch and render the
icon until it scrolls into view. You can change this with the loading
attribute;
see the docs for more info.
FAQs
Icon element for PatternFly Elements
We found that @patternfly/pfe-icon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.